package com.tongcao.cn.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author:tongcao
 * @Date:2018/8/25 17:48
 * Description:
 */
@Slf4j
@Component
public class MyTask2 implements Task {
    /**
     * 任务执行
     * Scheduled 适合串行执行
     */
    @Override
//    @Scheduled(fixedRate = 200000L)
    public void execute() {
        try {
            log.info("任务2执行开始。。。");
            Thread.sleep(1000L);
            log.info("任务2执行结束。。。");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
